package randx

import "math/rand"

// Shuffle 打乱切片的顺序
func Shuffle[T any](arr []T) {
	if arr == nil || len(arr) < 1 {
		return
	}
	rand.Shuffle(len(arr), func(i, j int) { arr[i], arr[j] = arr[j], arr[i] })
}
